package com.example.splash;



import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageButton;

/**
 * 
 * @author Dani
 * Activity class with just two buttons
 */

public class SplashActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
		
	Button	btnIr = (Button) findViewById(R.id.button1);
	Button btnChild = (Button) findViewById(R.id.button2);
	
	
	btnIr.setOnClickListener(new View.OnClickListener() {
		public void onClick(View v) {
        	 Intent intent = new Intent(SplashActivity.this, MainActivity.class);
        	 intent.putExtra("extraValue", "Hello");
  	       startActivity(intent);    
        }
    }); 
	
	btnChild.setOnClickListener(new View.OnClickListener() {
		public void onClick(View v) {
        	 Intent intent = new Intent(SplashActivity.this, ChildActivity.class);
        	      startActivityForResult(intent, 666);    
        }
    }); 
	
	
	
	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		
		Log.d("Debug", "Req code: " + requestCode + ". Result code " + resultCode);
		Log.d("Debug", "Extra code: " + data.getStringExtra("someData"));
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.splash, menu);
		return true;
	}


}
